import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/',
      component:(resolve)=>require(["@/home/layout"],resolve),
      meta:{
        title:"合作商协作系统"
      },
      children:[
        {
          path:'/',
          name:"",
          component:(resolve)=>require(["@/home/index"],resolve),
          meta:{
            title:'主页'
          }
        },
        {
          path:'/index',
          name:"index",
          component:(resolve)=>require(["@/home/index"],resolve),
          meta:{
            title:'主页'
          }
        }],
    },
    {
      path:'/deliver/list',
      component:(resolve)=>require(["@/deliver/index"],resolve),
      meta:{
        title:"快递查询"
      },
    },
    {
      path:'/share/order',
      component:(resolve)=>require(["@/share/order"],resolve),
      meta:{
        title:"订单跟踪"
      },
    },
    {
      path:'/admin/login',
      name:"adminlogin",
      component:(resolve)=>require(["@/admin/login"],resolve),
      meta:{
        title:'管理员登录'
      }
    },
    {
      path:'/supplier/login',
      name:"supplierlogin",
      component:(resolve)=>require(["@/supplier/login"],resolve),
      meta:{
        title:'合作商登录'
      }
    },
    {
      path: '/admin',
      name: 'admin',
      component: (resolve) => require(['@/admin/layout'], resolve),
      children:[
        {
          path:'/admin/index',
          name:"adminindex",
          component:(resolve)=>require(["@/admin/index"],resolve),
          meta:{
            title:'系统概览'
          }
        },
        {
          path:'/admin/product/list',
          name:"admin-product-list",
          component:(resolve)=>require(["@/admin/product/index"],resolve),
          meta:{
            title:'产品查询'
          }
        },
        {
          path:'/admin/productnew/list',
          name:"admin-productnew-list",
          component:(resolve)=>require(["@/admin/productnew/index"],resolve),
          meta:{
            title:'产品上架'
          }
        },
        {
          path:'/admin/buysupplier/index',
          name:"admin-buysupplier-index",
          component:(resolve)=>require(["@/admin/buysupplier/index"],resolve),
          meta:{
            title:'采购供应商'
          }
        },
        {
          path:'/admin/buylist/list',
          name:"admin-buylist-list",
          component:(resolve)=>require(["@/admin/buylist/index"],resolve),
          meta:{
            title:'采购合同'
          }
        },
        {
          path:'/admin/buydetail/list',
          name:"admin-buydetail-list",
          component:(resolve)=>require(["@/admin/buydetail/index"],resolve),
          meta:{
            title:'采购明细'
          }
        },
        {
          path:'/admin/buypayment/list',
          name:"admin-buypayment-list",
          component:(resolve)=>require(["@/admin/buypayment/index"],resolve),
          meta:{
            title:'采购付款'
          }
        },
        {
          path:'/admin/buyexchange/index',
          name:"admin-buyexchange-index",
          component:(resolve)=>require(["@/admin/buyexchange/index"],resolve),
          meta:{
            title:'采购退换货'
          }
        },
        {
          path:'/admin/client/index',
          name:"admin-client-index",
          component:(resolve)=>require(["@/admin/client/index"],resolve),
          meta:{
            title:'客户管理'
          }
        },
        {
          path:'/admin/clientuser/index',
          name:"admin-clientuser-index",
          component:(resolve)=>require(["@/admin/clientuser/index"],resolve),
          meta:{
            title:'客户联系人'
          }
        },
        {
          path:'/admin/order/list',
          name:"admin-order-list",
          component:(resolve)=>require(["@/admin/order/index"],resolve),
          meta:{
            title:'销售订单'
          }
        },
        {
          path:'/admin/orderdetail/index',
          name:"admin-orderdetail-index",
          component:(resolve)=>require(["@/admin/orderdetail/index"],resolve),
          meta:{
            title:'销售明细'
          }
        },
        {
          path:'/admin/orderdetail/list',
          name:"admin-orderdetail-list",
          component:(resolve)=>require(["@/admin/orderdetail/index"],resolve),
          meta:{
            title:'销售明细'
          }
        },

        {
          path:'/admin/buyticket/list',
          name:"admin-buyticket-list",
          component:(resolve)=>require(["@/admin/buyticket/index"],resolve),
          meta:{
            title:'进项发票'
          }
        },
        {
          path:'/admin/buyticketdetail/list',
          name:"admin-buyticketdetail-list",
          component:(resolve)=>require(["@/admin/buyticketdetail/index"],resolve),
          meta:{
            title:'进项明细'
          }
        },
        {
          path:'/admin/saleticket/list',
          name:"admin-saleticket-list",
          component:(resolve)=>require(["@/admin/saleticket/index"],resolve),
          meta:{
            title:'销项发票'
          }
        },
        {
          path:'/admin/saleticketdetail/list',
          name:"admin-saleticketdetail-list",
          component:(resolve)=>require(["@/admin/saleticketdetail/index"],resolve),
          meta:{
            title:'销项明细'
          }
        },
        {
          path:'/admin/unsale/index',
          name:"admin-unsale-index",
          component:(resolve)=>require(["@/admin/unsale/index"],resolve),
          meta:{
            title:'库存明细'
          }
        },
        {
          path:'/admin/zangu/index',
          name:"admin-zangu-index",
          component:(resolve)=>require(["@/admin/zangu/index"],resolve),
          meta:{
            title:'暂估明细'
          }
        },
        {
          path:'/admin/income/list',
          name:"admin-income-list",
          component:(resolve)=>require(["@/admin/income/index"],resolve),
          meta:{
            title:'收款记录'
          }
        },
        {
          path:'/admin/payment/list',
          name:"admin-payment-list",
          component:(resolve)=>require(["@/admin/payment/index"],resolve),
          meta:{
            title:'付款记录'
          }
        },
          {
            path:'/admin/account/list',
            name:"admin-account-list",
            component:(resolve)=>require(["@/admin/account/index"],resolve),
            meta:{
              title:'账套管理'
            }
          },
        {
          path:'/admin/supplier/list',
          name:"admin-supplier-list",
          component:(resolve)=>require(["@/admin/supplier/index"],resolve),
          meta:{
            title:'合作商管理'
          }
        },
        {
          path:'/admin/platform/list',
          name:"admin-platform-list",
          component:(resolve)=>require(["@/admin/platform/index"],resolve),
          meta:{
            title:'合作商管理'
          }
        },
        {
          path:'/admin/mate/list',
          name:"admin-mate-list",
          component:(resolve)=>require(["@/admin/mate/index"],resolve),
          meta:{
            title:'业务员列表'
          }
        },
        {
          path:'/admin/s2clist/index',
          name:"admin-s2clist-index",
          component:(resolve)=>require(["@/admin/s2clist/index"],resolve),
          meta:{
            title:'销售成本对应表'
          }
        }
      ]
    },
    {
      path: '/supplier',
      name: 'supplier',
      component: (resolve) => require(['@/supplier/layout'], resolve),
      children:[
        {
          path:'/supplier/index',
          name:"supplierindex",
          component:(resolve)=>require(["@/supplier/index"],resolve),
          meta:{
            title:'系统概览'
          }
        },
        {
          path:'/supplier/productnew/list',
          name:"supplierproductnewlist",
          component:(resolve)=>require(["@/supplier/productnew/index"],resolve),
          meta:{
            title:'系统概览'
          }
        },
        {
          path:'/supplier/product/list',
          name:"supplierproductlist",
          component:(resolve)=>require(["@/supplier/product/index"],resolve),
          meta:{
            title:'产品查询'
          }
        },
        {
          path:'/supplier/order/list',
          name:"supplierorderlist",
          component:(resolve)=>require(["@/supplier/order/index"],resolve),
          meta:{
            title:'销售订单'
          }
        },
      ]
    }

  ]
})
